import { EntityObjectFactory } from './../entityObjectFactory';
var EntityObject = EntityObjectFactory.GetEntityObjectType();

export class ExpeditionOrder extends EntityObject<ExpeditionOrder>{
    constructor(ctx?) { super(ctx); }
    id: string;

    /**
     * 出品单的序列号 ‘K-1-12’
     * 
     * @type {string}
     * @memberOf ExpeditionOrder
     */
    serialNo: string;

    kitchenOrderIds: [string];

    /**
     * 出品人
     * 
     * @type {{ id: string; name: string }}
     * @memberOf ExpeditionOrder
     */
    expediter: { id: string; name: string };

    /**
     * 出品人Id
     * 
     * @type {string}
     * @memberOf ExpeditionOrder
     */
    expediterId: string;
    beginTime: number;
    finishTime: number;

    /**
     * 出品单状态 init 初始化 | expedited 已出品 | delivered 已传菜
     * 
     * @type {string}
     * @memberOf ExpeditionOrder
     */
    status: "init" | "expedited" | "delivered" | "cancel";

    terminalId: string;

    items: ExpeditionOrderItem[];

    qty: number;
    toString(): string { return "ExpeditionOrder"; }
    sourceTerminalId: string;
}

export interface ExpeditionOrderItem {
    id: string;
    kitchenOrderId: string;
    kitchenOrderItemId: string;
    qty: number;
    refundQty:number;
    inventoryId: string;
    inventoryName: string;
    inventoryCode: string;
    /**
     * 出品人
     * 
     * @type {{ id: string; name: string }}
     * @memberOf ExpeditionOrder
     */
    expediter: { id: string; name: string };

    /**
     * 出品人Id
     * 
     * @type {string}
     * @memberOf ExpeditionOrder
     */
    expediterId: string;

    /**
     * 客户标识，台桌名称 | 号牌名称
     * 
     * @type {string}
     * @memberOf ExpeditionOrderItem
     */
    customerIdentity: string;
    tableId:string;

    extended: {
        categories:any;
        table?:{
            id:string;
            name:string;
            zone?:{
                id:string;
                name:string;
            }
        },
        receiveTime:number;
    }
}